<?php

namespace App\Http\Requests\Admin;

use Illuminate\Foundation\Http\FormRequest;

class NewsCreateRequest extends FormRequest
{
    /**
     * Determine if the user is authorized to make this request.
     *
     * @return bool
     */
    public function authorize()
    {
        return true;
    }

    /**
     * Get the validation rules that apply to the request.
     *
     * @return array
     */
    public function rules()
    {
        return [
            "title"=>"required",
            "category_id"=>"required",
            "meta_keyword"=>"required",
            "meta_description"=>"required",
            "content"=>"required",
        ];
    }

    public function messages()
    {
        return [
            "title.required"=>"名字不能够为空",
            "category_id.required"=>"分类不能够为空",
            "meta_keyword.required"=>"关键字不能够为空",
            "meta_description.required"=>"描述不能够为空",
            "content.required"=>"内容不能够为空",
        ];
    }
}
